/**
 * 
 */
package com.jw.server.model;

import javax.persistence.Entity;

import cn.ydx.protobuf.OTIpcDef;

/**
 * @author Jason Biao
 *
 *         网约车车辆保险信息接口
 */
@Entity
public class BaseInfoVehicleInsurance extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6700845094505037654L;

	private String vehicleNo;

	private String insurCom;

	private String insurNum;

	private String insurType;

	private String insurCount;

	private int insurEff;

	private int insurExp;

	public String getVehicleNo() {
		return vehicleNo;
	}

	public void setVehicleNo(String vehicleNo) {
		this.vehicleNo = vehicleNo;
	}

	public String getInsurCom() {
		return insurCom;
	}

	public void setInsurCom(String insurCom) {
		this.insurCom = insurCom;
	}

	public String getInsurNum() {
		return insurNum;
	}

	public void setInsurNum(String insurNum) {
		this.insurNum = insurNum;
	}

	public String getInsurType() {
		return insurType;
	}

	public void setInsurType(String insurType) {
		this.insurType = insurType;
	}

	public String getInsurCount() {
		return insurCount;
	}

	public void setInsurCount(String insurCount) {
		this.insurCount = insurCount;
	}

	public int getInsurEff() {
		return insurEff;
	}

	public void setInsurEff(int insurEff) {
		this.insurEff = insurEff;
	}

	public int getInsurExp() {
		return insurExp;
	}

	public void setInsurExp(int insurExp) {
		this.insurExp = insurExp;
	}

	 public static OTIpcDef.BaseInfoVehicleInsurance convert(BaseInfoVehicleInsurance data){
	        OTIpcDef.BaseInfoVehicleInsurance item = OTIpcDef.BaseInfoVehicleInsurance.newBuilder()
	                .setCompanyId(data.getCompanyId())
	                .setVehicleNo(data.getVehicleNo())
	                .setInsurCom(data.getInsurCom())
	                .setInsurNum(data.getInsurNum())
	                .setInsurType(data.getInsurType())
	                .setInsurCount(Float.valueOf(data.getInsurCount()))
	                .setInsurEff(Long.valueOf(data.getInsurEff()))
	                .setInsurExp(Long.valueOf(data.getInsurExp()))
	                .setFlag(data.getFlag())
	                .setUpdateTime(Long.valueOf(data.getUpdateTime()))
	                .build();

	        return item;
	    }
	 
	 
	 public static  BaseInfoVehicleInsurance convertPojo(OTIpcDef.BaseInfoVehicleInsurance data){
		 BaseInfoVehicleInsurance bivi=new BaseInfoVehicleInsurance();
		 bivi.setCompanyId(data.getCompanyId());
		 bivi.setFlag(data.getFlag());
		 bivi.setInsurCom(data.getInsurCom());
		 bivi.setInsurCount(data.getInsurCount()+"");
		 bivi.setInsurEff((int)data.getInsurEff());
		 bivi.setInsurExp((int)data.getInsurExp());
		 bivi.setInsurNum(data.getInsurNum());
		 bivi.setInsurType(data.getInsurType());
		 bivi.setUpdateTime(data.getUpdateTime());
		 bivi.setVehicleNo(data.getVehicleNo());
		 
		 return bivi;
	 }
}
